package com.iv.durian.cloud.dao;

import com.iv.durian.cloud.Lesson;
import com.iv.durian.cloud.dao.mapper.LessonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by zlw on 2018-06-30.
 */
@Repository
public class LessonDao {

    @Autowired
    private LessonMapper lessonMapper;

    public Lesson get(Integer id, String lessonName){
        return lessonMapper.get(id,lessonName);
    }

    public int add( Lesson lesson){
        return lessonMapper.add(lesson);
    }

    public int updateLessonName(int id,String lessonName){
        return lessonMapper.updateLessonName(id,lessonName);
    }

    public List<Lesson> list(Integer status, int offset, int limit){
        return lessonMapper.list(status,offset,limit);
    }

    public int count(Integer status){
        return lessonMapper.count(status);
    }

    public void delete(Integer lessonId, String lessonName){
        lessonMapper.delete(lessonId, lessonName);
    }


}
